package com.zjdiepu.www.commpent.mapper.dh;

import javax.annotation.Resource;

import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.stereotype.Component;

import com.zjdiepu.www.base.core.BaseMapper;
import com.zjdiepu.www.base.enums.type.DataDicType;
import com.zjdiepu.www.commpent.RedisObjectClient;
import com.zjdiepu.www.model.base.dto.SimpleDataDictionary;
import com.zjdiepu.www.model.dh.dto.DhInsuranceCompensation;
/**
 * 项目名称：dpqc-parent-manager-information <br/> 
 * 类名称：YwBusinessMapper <br/>  
 * 类描述：字段转换 <br/>    
 * 创建人：xiongxiaotun <br/> 
 * 创建时间：2017年4月25日 下午5:51:41  <br/>   
 * 修改人：xiongxiaotun <br/> 
 * 修改时间：2017年4月25日 下午5:51:41   <br/>  
 * 修改备注：    <br/> 
 * @version V1.0   <br/>
 */
@Component
public class DhInsuranceCompensationVoMapper extends BaseMapper<DhInsuranceCompensation>{
	@Resource
	private RedisObjectClient redisObjectClient;
	
	@Override
	public void mapper(RedisConnection redisConnection,DhInsuranceCompensation m) {
		if(null == m) {
			return;
		}
		String natureCase = m.getNatureCase();
		SimpleDataDictionary simpleDataDictionary1 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(), natureCase, DataDicType.COMPENSATION_CASENATURE.getCode());
		m.setNatureCaseDisplay(simpleDataDictionary1 == null ? "" : simpleDataDictionary1.getName());
		
		String typeRemit = m.getTypeRemit();
		SimpleDataDictionary simpleDataDictionary2 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(), typeRemit, DataDicType.COMPENSATION_REMITTYPE.getCode());
		m.setTypeRemitDisplay(simpleDataDictionary2 == null ? "" : simpleDataDictionary2.getName());
	}
}
